import { getProductListByParams, getBannerList, getCompanyList, getExpertList } from "@/api/api";

export default {
  name: 'home',
  components: {}, 
  props: [],
  data () {
    return {
      activeName2: 'first',
      tableData:[],
      banner:[],
      company:[],
      expertList:[]
    }
  },
  computed: {

  },
  mounted () {

  },
  created(){
   this._getListData();
    this._Banner();
    this._getCompanyList();
    this._getExpertList();
  },
  methods: {
    _getListData(){
      getProductListByParams().then(res=>{
        // console.log(res)
        this.tableData=res.data.slice(0,6)
      })
    },
    _Banner(){
      getBannerList().then(res=>{
        this.banner=res
        
      })
    },
    // 公司列表
    _getCompanyList(){
      getCompanyList().then(res=>{
        this.company=res.slice(0,4)
    
      })
    },
    // 专家列表
    _getExpertList(){
      getExpertList().then(res=>{
        console.log(res.data)
        this.expertList=res.data
      })
    }
  }

}
